package com.guli.gulimall.product.web;

import com.guli.gulimall.product.service.CategoryService;
import com.guli.gulimall.product.vo.Catalog2Vo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;

@Controller
public class HiController {

    @Autowired
    private CategoryService categoryService;

    @RequestMapping("/")
    public String list(){
        return "index";
    }

    @GetMapping("/index/json/catalog")
    @ResponseBody
    public HashMap<String, List<Catalog2Vo>> catalogList(){
        return categoryService.catalogList();
    }
}
